package Function;

import book.BookList;

import java.util.Scanner;

public class Borrow implements All {
    public void work(BookList book){

        System.out.println("请输入你要借书的名字：");
        Scanner in=new Scanner(System.in);
        String bookname3=in.nextLine();
        for(int i=0;i<book.getCount();i++){
            if(bookname3.equals(book.getBook1(i).getName())&&book.getBook1(i).getBorrow().equals("未借出")){
                book.getBook1(i).setBorrow("已借出");
                System.out.println("借出成功------");
                return;
            }
        }
        System.out.println("对不起，您要的书没有找到！！！！！");
        return;
    }
}
